home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1998 January / PC Answers Issue 49 Cover CD January 1998.iso / Apps / Director / DATA.Z / Widget Wizard.dir / WidgtBehaviors_23_Send All Sprites.ls < prev    next >
Encoding:
Text File  |  1997-05-10  |  932 b   |  46 lines

  1. property whichevent, EventToSend
  2.  
  3. on getPropertyDescriptionList
  4.   set description to [:]
  5.   addProp(description, #whichevent, [#default: #mouseUp, #format: #symbol, #comment: "On Which Event:", #range: [#mouseUp, #mouseDown, #enterFrame, #exitFrame]])
  6.   addProp(description, #EventToSend, [#default: #generic_event, #format: #symbol, #comment: "Event To Send:"])
  7.   return description
  8. end
  9.  
  10. on getBehaviorDescription
  11.   return "Send an event to all sprites"
  12. end
  13.  
  14. on getAssocMembers
  15.   set myPropList to []
  16.   return myPropList
  17. end
  18.  
  19. on do_it me
  20.   sendAllSprites(the EventToSend of me)
  21. end
  22.  
  23. on mouseUp me
  24.   if the whichevent of me = #mouseUp then
  25.     do_it(me)
  26.   end if
  27. end
  28.  
  29. on mouseDown me
  30.   if the whichevent of me = #mouseDown then
  31.     do_it(me)
  32.   end if
  33. end
  34.  
  35. on enterFrame me
  36.   if the whichevent of me = #enterFrame then
  37.     do_it(me)
  38.   end if
  39. end
  40.  
  41. on exitFrame me
  42.   if the whichevent of me = #exitFrame then
  43.     do_it(me)
  44.   end if
  45. end
  46.